﻿// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_PROD_HISTORY_TECHNIC_ITEM_DETAIL
// * CreateDate    : 2012/4/19 16:56:46
// * Creater       : CodeSmith
// * LastChangeDate: 2012/4/19 16:56:46
// * LastChanger   : 2012/4/19 16:56:46
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Suzsoft.Smart.Data;
using ESOL.Common.Entity;

namespace ESOL.Business.Prod
{
    /// <summary>
    /// ProdHistoryTechnicItemDetail
    /// </summary>
    public partial class ProdHistoryTechnicItemDetailBs
    {
        #region GetByID
        /// <summary>
        /// Get Entity
        /// </summary>
        /// <param name="objProdHistoryTechnicItemDetailEntity">Entity</param>
        /// <returns>Entity</returns>
        public static ProdHistoryTechnicItemDetailEntity GetProdHistoryTechnicItemDetail(ProdHistoryTechnicItemDetailEntity objProdHistoryTechnicItemDetailEntity)
        {
            return DataAccess.SelectSingle<ProdHistoryTechnicItemDetailEntity>(objProdHistoryTechnicItemDetailEntity);
        }
        #endregion


        #region Insert
        /// <summary>
        /// Insert Data
        /// </summary>
        /// <param name="objProdHistoryTechnicItemDetailEntity">Entity</param>
        /// <returns>true Insert Succeed; false Insert Fail</returns>
        public static bool InsertProdHistoryTechnicItemDetail(ProdHistoryTechnicItemDetailEntity objProdHistoryTechnicItemDetailEntity)
        {
            return DataAccess.Insert(objProdHistoryTechnicItemDetailEntity);
        }

        public static bool InsertProdHistoryTechnicItemDetail(List<ProdHistoryTechnicItemDetailEntity> objProdHistoryTechnicItemDetailEntityList)
        {
            return DataAccess.Insert(objProdHistoryTechnicItemDetailEntityList);
        }
        #endregion


        #region Update
        /// <summary>
        /// Update Data
        /// </summary>
        /// <param name="objProdHistoryTechnicItemDetailEntity">Entity</param>
        /// <returns>true Update Succeed; false Update Fail</returns>
        public static bool UpdateProdHistoryTechnicItemDetail(ProdHistoryTechnicItemDetailEntity objProdHistoryTechnicItemDetailEntity)
        {
            return DataAccess.Update(objProdHistoryTechnicItemDetailEntity);
        }

        public static bool UpdateProdHistoryTechnicItemDetail(List<ProdHistoryTechnicItemDetailEntity> objProdHistoryTechnicItemDetailEntityList)
        {
            return DataAccess.Update<ProdHistoryTechnicItemDetailEntity>(objProdHistoryTechnicItemDetailEntityList);
        }
        #endregion


        #region Delete
        /// <summary>
        /// Delete Data
        /// </summary>
        /// <param name="objProdHistoryTechnicItemDetailEntity">Entity</param>
        /// <returns>true Delete Succeed; false Delete Fail</returns>
        public static bool DeleteProdHistoryTechnicItemDetail(ProdHistoryTechnicItemDetailEntity objProdHistoryTechnicItemDetailEntity)
        {
            return DataAccess.Delete(objProdHistoryTechnicItemDetailEntity);
        }

        public static bool DeleteProdHistoryTechnicItemDetail(List<ProdHistoryTechnicItemDetailEntity> objProdHistoryTechnicItemDetailEntityList)
        {
            return DataAccess.Delete<ProdHistoryTechnicItemDetailEntity>(objProdHistoryTechnicItemDetailEntityList);
        }
        #endregion


        #region GetAll
        /// <summary>
        /// Get All Data
        /// </summary>
        /// <returns>Back All Data<returns>
        public static DataSet GetProdHistoryTechnicItemDetailAll()
        {
            return DataAccess.SelectAllDataSet<ProdHistoryTechnicItemDetailEntity>();
        }
        /// <summary>
        /// Get All Data List
        /// </summary>
        /// <returns>Back All Data List<returns>
        public static List<ProdHistoryTechnicItemDetailEntity> GetProdHistoryTechnicItemDetailAllList()
        {
            return DataAccess.SelectAll<ProdHistoryTechnicItemDetailEntity>();
        }
        #endregion

        #region Functions
        public static DataTable GetDtAllByHistoryTechnicItemID(string sHistoryTechnicItemID)
        {
            string sql = @"select phtid.*,mp.NAME_CN from PROD_HISTORY_TECHNIC_ITEM_DETAIL phtid
left join MST_PERSON mp on phtid.GROUP_PERSON=mp.PERSON_ID
where phtid.HISTORY_TECHNIC_ITEM_ID=''";
            return DataAccess.SelectDataSet(sql).Tables[0];
        }
        #endregion
    }


}

